﻿using System;

namespace Bioinformatics.Types
{
    [Serializable]
    public class GeneticSequence
    {
        public static GeneticSequence EmptySequence;

        public GeneticSequence()
        {
            Sequence = string.Empty;
            SourceSpecies = Species.NoSpecies;
            StartBase = 0;
        }

        public char this[int index]
        {
            get { return Sequence[index]; }
        }

        public Alphabet Alphabet { get; set; }
        public string AccessionId { get; set; }
        public DateTime Created { get; set; }
        public string Database { get; set; }
        public string DatabaseId { get; set; }
        public string Description { get; set; }

        public int EndBase
        {
            get { return StartBase + Sequence.Length; }
        }

        public string FriendlyName { get; set; }
        public string Gi { get; set; }
        public string Sequence { get; set; }
        public Species SourceSpecies { get; set; }
        public int StartBase { get; set; }
        public DateTime Updated { get; set; }

        public override string ToString()
        {
            return AccessionId + " (" + FriendlyName + ")";
        }
    }
}